package com.ysxsoft.wdg.adapter.order;

import android.widget.ImageView;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.ysxsoft.wdg.R;
import com.ysxsoft.wdg.bean.BannerBean;
import com.ysxsoft.wdg.bean.cart.ShopcartBean;
import com.ysxsoft.wdg.util.ViewUtils;

import java.util.List;

public class ZyOrderDetailAdapter extends BaseQuickAdapter<ShopcartBean,BaseViewHolder> {


    public ZyOrderDetailAdapter(int layoutResId) {
        super(layoutResId);
    }

    public void clear(){
        getData().clear();
        notifyDataSetChanged();
    }

    @Override
    protected void convert(BaseViewHolder helper, ShopcartBean item) {

        ViewUtils.loadImage(mContext,item.getPic(), (ImageView) helper.getView(R.id.iv_goods));
        helper.setText(R.id.tv_goods_name,item.getProduct_name());
        helper.setText(R.id.tv_rules,item.getRule_name());

        helper.setText(R.id.tv_money,mContext.getString(R.string.price_rmb,item.getL_price()));
        helper.setText(R.id.tv_num,"x"+item.getNum());

    }
}
